USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  Table [dbo].[DELIVERY_CHALAN]    Script Date: 07-Jun-14 11:52:38 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[DELIVERY_CHALAN](
	[DC_ID] [int] IDENTITY(1,1) NOT NULL,
	[DC_NO] [varchar](50) NOT NULL,
	[TRACTOR_ID] [int] NOT NULL,
	[SALES_INVOICE_ID] [int] NULL,
	[DC_DATE] [datetime] NOT NULL,
	[HYPOTHETICATION] [varchar](50) NULL,
	[IS_DC] [bit] NOT NULL,
	[CUSTOMER_ID] [int] NOT NULL,
	[VAT_PERCENT] [decimal](18, 2) NULL,
 CONSTRAINT [PK_DELIVERY_CHALAN] PRIMARY KEY CLUSTERED 
(
	[DC_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[DELIVERY_CHALAN]  WITH CHECK ADD  CONSTRAINT [FK_DELIVERY_CHALAN_CUSTOMER] FOREIGN KEY([CUSTOMER_ID])
REFERENCES [dbo].[CUSTOMER] ([CUSTOMER_ID])
GO

ALTER TABLE [dbo].[DELIVERY_CHALAN] CHECK CONSTRAINT [FK_DELIVERY_CHALAN_CUSTOMER]
GO

ALTER TABLE [dbo].[DELIVERY_CHALAN]  WITH CHECK ADD  CONSTRAINT [FK_DELIVERY_CHALAN_SALES_INVOICES] FOREIGN KEY([SALES_INVOICE_ID])
REFERENCES [dbo].[SALES_INVOICES] ([SALES_INVOICE_ID])
GO

ALTER TABLE [dbo].[DELIVERY_CHALAN] CHECK CONSTRAINT [FK_DELIVERY_CHALAN_SALES_INVOICES]
GO

ALTER TABLE [dbo].[DELIVERY_CHALAN]  WITH CHECK ADD  CONSTRAINT [FK_DELIVERY_CHALAN_TRACTOR_PURCHASES] FOREIGN KEY([TRACTOR_ID])
REFERENCES [dbo].[TRACTOR_PURCHASES] ([TRACTOR_ID])
GO

ALTER TABLE [dbo].[DELIVERY_CHALAN] CHECK CONSTRAINT [FK_DELIVERY_CHALAN_TRACTOR_PURCHASES]
GO

